package cc.eddic.practice.spring.domain;

import cc.eddic.practice.spring.jpa.BaseEntity;
import lombok.*;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;

@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name="t_option")
@Builder
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class Option extends BaseEntity {

    public void changeToCorrectAnswer(){
        this.isCorrectAnswer = true;
    }
    private String answer;
    private char choice;
    private boolean isCorrectAnswer;
    private Question question;

}
